<template>
  <!-- 广告创建+广告分享 -->
    <div class="foundBox">
      <div class="found-item" v-for="(item, index) in foundList" :class="{'active': foundeIndex == index}" :key="index" @mouseover.stop="foundEnter(index)" @mouseout="foundOut(index)" @click="target(index)">
        <span :class="item.class"></span>
        <strong>{{ item.text }}</strong>
      </div>
    </div>
</template>

<script>
export default {
  data() {
    return {
      foundeIndex:2,
      foundList: [
        { class: "el-icon-s-opportunity", text: "广告创建" },
        { class: "el-icon-share", text: "系统分享" },
      ],
    };
  },
  methods:{
    // 移入操作
    foundEnter(index){
      this.foundeIndex = index;
    },
    // 移出操作
    foundOut(index){
      this.foundeIndex = 2;
    },
    // 点击跳转
    target(index){
      if(index == 0){
        this.$router.push({path:'/createAds'})
      }else{

      }
    }
  }
};
</script>

<style scoped lang="less">
.foundBox {
  width: auto;
  height: auto;
  overflow: hidden;
  position: fixed;
  right: 0px;
  top: 50%;
  margin-top: -40px;
  width: auto;
  height: auto;
  .found-item {
    width: auto;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background-color: #fff;
    border-radius: 8px 0px 0px 8px;
    padding: 0px 15px;
    box-sizing: border-box;
    border: 1px #cfcfcf solid;
    border-right: none;
    margin-right: -70px;
    cursor: pointer;
    transition: all 0.5s;
    &:first-child {
      margin-bottom: 6px;
    }
    span {
      float: left;
      display: inline-block;
      width: auto;
      line-height: 40px;
      font-size: 14px;
      margin-right: 10px;
    }
    strong {
      float: left;
      display: inline-block;
      line-height: 40px;
      font-size: 14px;
      color: #666;
    }
  }
  .active{
    margin-right: 0px;
  }
}
</style>